using foreach loops in php